<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DM-CtrlH7-BF-DevProgram: C:/Users/ASUS/Desktop/dm-ctrlH7-balance-9025test/modules/algorithm/QuaternionEKF.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="50x5.png"/></td>
  <td id="projectalign">
   <div id="projectname">DM-CtrlH7-BF-DevProgram<span id="projectnumber">&#160;beta 0.1</span>
   </div>
   <div id="projectbrief">C.ONE Studio Damiao Development Board Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(function(){initNavTree('_quaternion_e_k_f_8c.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">QuaternionEKF.c File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>attitude update with gyro bias estimate and chi-square test  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="_quaternion_e_k_f_8h_source.html">QuaternionEKF.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a43fed4fb5cef743a036ceb866de43628" id="r_a43fed4fb5cef743a036ceb866de43628"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a43fed4fb5cef743a036ceb866de43628">IMU_QuaternionEKF_Init</a> (float *init_quaternion, float process_noise1, float process_noise2, float measure_noise, float lambda, float lpf)</td></tr>
<tr class="memdesc:a43fed4fb5cef743a036ceb866de43628"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quaternion EKF initialization and some reference value.  <br /></td></tr>
<tr class="memitem:aae827fb4d03a3d115e6ad61501dda590" id="r_aae827fb4d03a3d115e6ad61501dda590"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aae827fb4d03a3d115e6ad61501dda590">IMU_QuaternionEKF_Update</a> (float gx, float gy, float gz, float ax, float ay, float az, float dt)</td></tr>
<tr class="memdesc:aae827fb4d03a3d115e6ad61501dda590"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quaternion EKF update.  <br /></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-var-members" class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a2f6ee130c2912fa1106128c97aa54d69" id="r_a2f6ee130c2912fa1106128c97aa54d69"><td class="memItemLeft" align="right" valign="top"><a id="a2f6ee130c2912fa1106128c97aa54d69" name="a2f6ee130c2912fa1106128c97aa54d69"></a>
<a class="el" href="struct_q_e_k_f___i_n_s__t.html">QEKF_INS_t</a>&#160;</td><td class="memItemRight" valign="bottom"><b>QEKF_INS</b></td></tr>
<tr class="memitem:a5ff985346f2535a005af3c921af23f48" id="r_a5ff985346f2535a005af3c921af23f48"><td class="memItemLeft" align="right" valign="top">const float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5ff985346f2535a005af3c921af23f48">IMU_QuaternionEKF_F</a> [36]</td></tr>
<tr class="memitem:a21d0ce3767bc89c03d0037a3a5bd219e" id="r_a21d0ce3767bc89c03d0037a3a5bd219e"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a21d0ce3767bc89c03d0037a3a5bd219e">IMU_QuaternionEKF_P</a> [36]</td></tr>
<tr class="memitem:afee53610f74b2408ae7548f9cce19b54" id="r_afee53610f74b2408ae7548f9cce19b54"><td class="memItemLeft" align="right" valign="top"><a id="afee53610f74b2408ae7548f9cce19b54" name="afee53610f74b2408ae7548f9cce19b54"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>IMU_QuaternionEKF_K</b> [18]</td></tr>
<tr class="memitem:a3011e2fa4795ab6a359d141fedef06ea" id="r_a3011e2fa4795ab6a359d141fedef06ea"><td class="memItemLeft" align="right" valign="top"><a id="a3011e2fa4795ab6a359d141fedef06ea" name="a3011e2fa4795ab6a359d141fedef06ea"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>IMU_QuaternionEKF_H</b> [18]</td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>attitude update with gyro bias estimate and chi-square test </p>
<dl class="section author"><dt>Author</dt><dd>Wang Hongxi </dd></dl>
<dl class="section version"><dt>Version</dt><dd>V1.2.0 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2022/3/8 </dd></dl>
<dl class="section attention"><dt>Attention</dt><dd>1st order LPF transfer function: 1 ——————— as + 1 </dd></dl>
</div><a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
<a id="a43fed4fb5cef743a036ceb866de43628" name="a43fed4fb5cef743a036ceb866de43628"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a43fed4fb5cef743a036ceb866de43628">&#9670;&#160;</a></span>IMU_QuaternionEKF_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IMU_QuaternionEKF_Init </td>
          <td>(</td>
          <td class="paramtype">float *</td>          <td class="paramname"><span class="paramname"><em>init_quaternion</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>process_noise1</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>process_noise2</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>measure_noise</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>lambda</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>lpf</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Quaternion EKF initialization and some reference value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">process_noise1</td><td>quaternion process noise 10 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">process_noise2</td><td>gyro bias process noise 0.001 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">measure_noise</td><td>accel measure noise 1000000 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">lambda</td><td>fading coefficient 0.9996 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">lpf</td><td>lowpass filter coefficient 0 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aae827fb4d03a3d115e6ad61501dda590" name="aae827fb4d03a3d115e6ad61501dda590"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae827fb4d03a3d115e6ad61501dda590">&#9670;&#160;</a></span>IMU_QuaternionEKF_Update()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IMU_QuaternionEKF_Update </td>
          <td>(</td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>gx</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>gy</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>gz</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>ax</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>ay</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>az</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>dt</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Quaternion EKF update. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">gyro</td><td>x y z in rad/s </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">accel</td><td>x y z in m/s² </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">update</td><td>period in s </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a name="doc-var-members" id="doc-var-members"></a><h2 id="header-doc-var-members" class="groupheader">Variable Documentation</h2>
<a id="a5ff985346f2535a005af3c921af23f48" name="a5ff985346f2535a005af3c921af23f48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ff985346f2535a005af3c921af23f48">&#9670;&#160;</a></span>IMU_QuaternionEKF_F</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const float IMU_QuaternionEKF_F[36]</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= {1, 0, 0, 0, 0, 0,</div>
<div class="line">                                       0, 1, 0, 0, 0, 0,</div>
<div class="line">                                       0, 0, 1, 0, 0, 0,</div>
<div class="line">                                       0, 0, 0, 1, 0, 0,</div>
<div class="line">                                       0, 0, 0, 0, 1, 0,</div>
<div class="line">                                       0, 0, 0, 0, 0, 1}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a21d0ce3767bc89c03d0037a3a5bd219e" name="a21d0ce3767bc89c03d0037a3a5bd219e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a21d0ce3767bc89c03d0037a3a5bd219e">&#9670;&#160;</a></span>IMU_QuaternionEKF_P</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float IMU_QuaternionEKF_P[36]</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= {100000, 0.1, 0.1, 0.1, 0.1, 0.1,</div>
<div class="line">                                 0.1, 100000, 0.1, 0.1, 0.1, 0.1,</div>
<div class="line">                                 0.1, 0.1, 100000, 0.1, 0.1, 0.1,</div>
<div class="line">                                 0.1, 0.1, 0.1, 100000, 0.1, 0.1,</div>
<div class="line">                                 0.1, 0.1, 0.1, 0.1, 100, 0.1,</div>
<div class="line">                                 0.1, 0.1, 0.1, 0.1, 0.1, 100}</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a href="dir_e05d7e2b1ecd646af5bb94391405f3b5.html">modules</a></li><li class="navelem"><a href="dir_7f2cce0340e3bee62fc9457f37cf3f77.html">algorithm</a></li><li class="navelem"><a href="_quaternion_e_k_f_8c.html">QuaternionEKF.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
  </ul>
</div>
</body>
</html>
